home *** CD-ROM | disk | FTP | other *** search
- ; This example will fill an array with bytes taken from the data statements.
- ; Each byte can be anything from 0-255 but I've only used 0-3. The result
- ; should be a very small window with the image drawn in the center.
-
- FindScreen 0
- Window 0,50,50,35,35,0,"",0,0
-
- Dim chunk.b(15,15)
- Restore dat
- For y.w=0 To 15 : For x.w=0 To 15 : Read chunk(x,y) : Next x : Next y
-
- ; Write this array to the window starting at 10,10
- ; and ending at 25,15, the result is a 16x16 blit.
-
- *trp.RastPort=AllocMem_(SizeOf.RastPort,#MEMF_ANY|#MEMF_CLEAR)
- *bm.BitMap=AllocBitMap_(((16+15) LSL 4) LSR 1,1,8,#BMF_CLEAR,0)
- InitRastPort_ *trp
- *trp\Layer=0
- *trp\_BitMap=*bm
-
- WritePixelArray8_ RastPort(0),10,10,25,25,&chunk(0,0),*trp
-
- MouseWait
-
- FreeBitMap_ *bm
- FreeMem_ *trp,SizeOf.RastPort
-
- End
-
- dat:
- Data.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
- Data.b 0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0
- Data.b 0,0,0,0,0,1,1,2,2,1,1,0,0,0,0,0
- Data.b 0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0
- Data.b 0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0
- Data.b 0,0,1,1,0,0,0,3,3,0,0,0,1,1,0,0
- Data.b 0,0,1,1,0,0,0,3,3,0,0,0,1,1,0,0
- Data.b 0,1,2,2,1,3,3,1,1,3,3,1,2,2,1,0
- Data.b 0,1,2,2,1,3,3,1,1,3,3,1,2,2,1,0
- Data.b 0,0,1,1,0,0,0,3,3,0,0,0,1,1,0,0
- Data.b 0,0,1,1,0,0,0,3,3,0,0,0,1,1,0,0
- Data.b 0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0
- Data.b 0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0
- Data.b 0,0,0,0,0,1,1,2,2,1,1,0,0,0,0,0
- Data.b 0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0
- Data.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-
-
-
-